package GUILayer;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTextPane;
import javax.swing.JTextField;
import javax.swing.Box;
import javax.swing.border.TitledBorder;
import javax.swing.UIManager;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JComboBox;
import javax.swing.JButton;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.DefaultComboBoxModel;
import java.awt.Font;
import javax.swing.JList;
import javax.swing.JLabel;

import CtrLayer.SchemeCtr;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;


public class NursingDocumentation extends JFrame {

	private JPanel contentPane;
	private JLabel lblNewLabel;
	private JTextField t11;
	private JTextField t21;
	private JTextField t31;
	private JTextField t12;
	private JTextField t22;
	private JTextField t32;
	private JTextField t13;
	private JTextField t33;
	private JTextField t14;
	private JTextField t24;
	private JTextField t34;
	private JTextField t15;
	private JTextField t25;
	private JTextField t35;
	private JTextField t16;
	private JTextField t26;
	private JTextField t36;
	private JTextField t17;
	private JTextField t27;
	private JTextField t37;
	private JTextField t18;
	private JTextField t28;
	private JTextField t38;
	private JTextField t19;
	private JTextField t29;
	private JTextField t39;
	private JTextField t110;
	private JTextField t210;
	private JTextField t310;
	private JTextField t111;
	private JTextField t211;
	private JTextField t311;
	private JTextField t112;
	private JTextField t212;
	private JTextField t312;
	
	private JButton btnNewButton;
	
	private JButton btnNewButton_1;

	private JButton btnNewButton_2;
	private JButton btnNewButton_3;
	private JButton btnNewButton_4;
	private JTextField t23;
	private String name;
	

	/**
	 * Launch the application.
	 */
	
	

	/**
	 * Create the frame.
	 */
	public NursingDocumentation( final String name) {
		
		setTitle("Create Nursing Documentation");
		
		
		setBounds(100, 100, 874, 778);
		setVisible(true);
		this.name=name;
		contentPane = new JPanel();
		contentPane.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		
		lblNewLabel = new JLabel("");
		lblNewLabel.setBounds(181, 568, 307, 14);
		contentPane.add(lblNewLabel);
		
		JLabel lblNewLabel_1 = new JLabel( name);
		lblNewLabel_1.setBounds(79, 32, 38, 14);
		contentPane.add(lblNewLabel_1);
		
		
		JLabel lblNewLabel_2 = new JLabel("Communication");
		lblNewLabel_2.setBounds(79, 60, 123, 14);
		contentPane.add(lblNewLabel_2);
		
		JLabel lblNewLabel_3 = new JLabel("Knoledge/development");
		lblNewLabel_3.setBounds(78, 85, 161, 14);
		contentPane.add(lblNewLabel_3);
		
		JLabel lblNewLabel_4 = new JLabel("Respiration/circulation");
		lblNewLabel_4.setBounds(79, 110, 162, 14);
		contentPane.add(lblNewLabel_4);
		
		JLabel lblNewLabel_5 = new JLabel("Nutrition");
		lblNewLabel_5.setBounds(79, 135, 166, 14);
		contentPane.add(lblNewLabel_5);
		
		JLabel lblSleep = new JLabel("Sleep");
		lblSleep.setBounds(79, 235, 140, 14);
		contentPane.add(lblSleep);
		
		JLabel lblActivity = new JLabel("Activity");
		lblActivity.setBounds(79, 210, 140, 14);
		contentPane.add(lblActivity);
		
		JLabel lblSkintissue = new JLabel("Skin/Tissue");
		lblSkintissue.setBounds(79, 185, 152, 14);
		contentPane.add(lblSkintissue);
		
		JLabel lblExcretion = new JLabel("Excretion");
		lblExcretion.setBounds(79, 160, 123, 14);
		contentPane.add(lblExcretion);
		
		JLabel lblSpiritualcultural = new JLabel("Spiritual/cultural");
		lblSpiritualcultural.setBounds(79, 335, 140, 14);
		contentPane.add(lblSpiritualcultural);
		
		JLabel lblPsychsocial = new JLabel("Psychsocial");
		lblPsychsocial.setBounds(79, 310, 140, 14);
		contentPane.add(lblPsychsocial);
		
		JLabel lblSexualityreproduction = new JLabel("Sexuality/reproduction");
		lblSexualityreproduction.setBounds(79, 285, 173, 14);
		contentPane.add(lblSexualityreproduction);
		
		JLabel lblPainsensation = new JLabel("Pain/sensation");
		lblPainsensation.setBounds(79, 260, 164, 14);
		contentPane.add(lblPainsensation);
		
		t11 = new JTextField("");
		t11.setBounds(244, 57, 161, 20);
		contentPane.add(t11);
		t11.setColumns(10);
		
		t21 = new JTextField("");
		t21.setColumns(10);
		t21.setBounds(456, 57, 161, 20);
		contentPane.add(t21);
		
		t31 =new JTextField("");
		t31.setColumns(10);
		t31.setBounds(655, 57, 161, 20);
		contentPane.add(t31);
		
		t12 = new JTextField("");
		t12.setColumns(10);
		t12.setBounds(244, 82, 161, 20);
		contentPane.add(t12);
		
		t22 = new JTextField("");
		t22.setColumns(10);
		t22.setBounds(456, 82, 161, 20);
		contentPane.add(t22);
		
		t32 = new JTextField("");
		t32.setColumns(10);
		t32.setBounds(655, 82, 161, 20);
		contentPane.add(t32);
		
		t13 = new JTextField("");
		t13.setColumns(10);
		t13.setBounds(244, 107, 161, 20);
		contentPane.add(t13);
		
		t23 = new JTextField("");
		t23.setColumns(10);
		t23.setBounds(456, 107, 161, 20);
		contentPane.add(t23);
		
		t33 = new JTextField("");
		t33.setColumns(10);
		t33.setBounds(655, 107, 161, 20);
		contentPane.add(t33);
		
		t14 = new JTextField("");
		t14.setColumns(10);
		t14.setBounds(244, 132, 161, 20);
		contentPane.add(t14);
		
		t24 = new JTextField("");
		t24.setColumns(10);
		t24.setBounds(456, 132, 161, 20);
		contentPane.add(t24);
		
		t34 = new JTextField("");
		t34.setColumns(10);
		t34.setBounds(655, 132, 161, 20);
		contentPane.add(t34);
		
		t15 = new JTextField("");
		t15.setColumns(10);
		t15.setBounds(244, 157, 161, 20);
		contentPane.add(t15);
		
		t25 = new JTextField("");
		t25.setColumns(10);
		t25.setBounds(456, 157, 161, 20);
		contentPane.add(t25);
		
		t35 = new JTextField("");
		t35.setColumns(10);
		t35.setBounds(655, 157, 161, 20);
		contentPane.add(t35);
		
		t16 = new JTextField("");
		t16.setColumns(10);
		t16.setBounds(244, 182, 161, 20);
		contentPane.add(t16);
		
		t26 = new JTextField();
		t26.setColumns(10);
		t26.setBounds(456, 182, 161, 20);
		contentPane.add(t26);
		
		t36 = new JTextField("");
		t36.setColumns(10);
		t36.setBounds(655, 182, 161, 20);
		contentPane.add(t36);
		
		t17 = new JTextField("");
		t17.setColumns(10);
		t17.setBounds(244, 207, 161, 20);
		contentPane.add(t17);
		
		t27 = new JTextField("");
		t27.setColumns(10);
		t27.setBounds(456, 207, 161, 20);
		contentPane.add(t27);
		
		t37 = new JTextField("");
		t37.setColumns(10);
		t37.setBounds(655, 207, 161, 20);
		contentPane.add(t37);
		
		t18 = new JTextField("");
		t18.setColumns(10);
		t18.setBounds(244, 232, 161, 20);
		contentPane.add(t18);
		
		t28 = new JTextField("");
		t28.setColumns(10);
		t28.setBounds(456, 232, 161, 20);
		contentPane.add(t28);
		
		t38 = new JTextField("");
		t38.setColumns(10);
		t38.setBounds(655, 232, 161, 20);
		contentPane.add(t38);
		
		t19 = new JTextField("");
		t19.setColumns(10);
		t19.setBounds(244, 257, 161, 20);
		contentPane.add(t19);
		
		t29 = new JTextField("");
		t29.setColumns(10);
		t29.setBounds(456, 257, 161, 20);
		contentPane.add(t29);
		
		t39 = new JTextField("");
		t39.setColumns(10);
		t39.setBounds(655, 257, 161, 20);
		contentPane.add(t39);
		
		t110 = new JTextField("");
		t110.setColumns(10);
		t110.setBounds(244, 282, 161, 20);
		contentPane.add(t110);
		
		t210 = new JTextField("");
		t210.setColumns(10);
		t210.setBounds(456, 282, 161, 20);
		contentPane.add(t210);
		
		t310 = new JTextField("");
		t310.setColumns(10);
		t310.setBounds(655, 282, 161, 20);
		contentPane.add(t310);
		
		t111 = new JTextField("");
		t111.setColumns(10);
		t111.setBounds(244, 307, 161, 20);
		contentPane.add(t111);
		
		t211 = new JTextField("");
		t211.setColumns(10);
		t211.setBounds(456, 307, 161, 20);
		contentPane.add(t211);
		
		t311 = new JTextField("");
		t311.setColumns(10);
		t311.setBounds(655, 307, 161, 20);
		contentPane.add(t311);
		
		t112 = new JTextField("");
		t112.setColumns(10);
		t112.setBounds(244, 332, 161, 20);
		contentPane.add(t112);
		
		t212 = new JTextField("");
		t212.setColumns(10);
		t212.setBounds(456, 332, 161, 20);
		contentPane.add(t212);
		
		t312 = new JTextField("");
		t312.setColumns(10);
		t312.setBounds(655, 332, 161, 20);
		contentPane.add(t312);
		
		final JLabel  date1 = new JLabel("Date");
		date1.setBounds(289, 32, 118, 14);
		contentPane.add(date1);
		
		
		
		btnNewButton = new JButton("Select Date");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new SessionCalendar(date1);
			}
		});
		btnNewButton.setBounds(279, 11, 126, 23);
		contentPane.add(btnNewButton);
		
		final JLabel  date2 = new JLabel("Date");
		date2.setBounds(501, 32, 116, 14);
		contentPane.add(date2);
		
		btnNewButton_1 = new JButton("Select Date");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new SessionCalendar(date2);
			}
		});
		btnNewButton_1.setBounds(491, 11, 126, 23);
		contentPane.add(btnNewButton_1);
		
		final JLabel  date3 = new JLabel("Date");
		date3.setBounds(698, 32, 118, 14);
		contentPane.add(date3);
		
		btnNewButton_2 = new JButton("Select Date");
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new SessionCalendar(date3);
			}
		});
		btnNewButton_2.setBounds(688, 11, 128, 23);
		contentPane.add(btnNewButton_2);
		
		Box horizontalBox_1 = Box.createHorizontalBox();
		horizontalBox_1.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		horizontalBox_1.setBounds(225, 11, 210, 358);
		contentPane.add(horizontalBox_1);
		
		Box horizontalBox_2 = Box.createHorizontalBox();
		horizontalBox_2.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		horizontalBox_2.setBounds(434, 11, 204, 358);
		contentPane.add(horizontalBox_2);
		
		Box horizontalBox_3 = Box.createHorizontalBox();
		horizontalBox_3.setBorder(new TitledBorder(null, "", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		horizontalBox_3.setBounds(637, 11, 199, 358);
		contentPane.add(horizontalBox_3);
		
		Box horizontalBox = Box.createHorizontalBox();
		horizontalBox.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Nursing Documentation", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		horizontalBox.setBounds(10, 0, 218, 372);
		contentPane.add(horizontalBox);
		
		btnNewButton_3 = new JButton("Add");
		btnNewButton_3.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				if(!date1.getText().equals("Date")){
					if(!date2.getText().equals("Date"))
					{
						if(!date3.getText().equals("Date")){
							try{
								SchemeCtr schemeCtr= new SchemeCtr();
								schemeCtr.createNursingDocumentation(name,t11.getText(),t12.getText(),t13.getText(),t14.getText(),t15.getText(),t16.getText(),
										t17.getText(),t18.getText(),t19.getText(),t110.getText(),t111.getText(),t112.getText(),date1.getText());
								schemeCtr.createNursingDocumentation(name,t21.getText(),t22.getText(),t23.getText(),t24.getText(),t25.getText(),t26.getText(),
										t27.getText(),t28.getText(),t29.getText(),t210.getText(),t211.getText(),t212.getText(),date2.getText());
								schemeCtr.createNursingDocumentation(name,t31.getText(),t32.getText(),t33.getText(),t34.getText(),t35.getText(),t36.getText(),
										t37.getText(),t38.getText(),t39.getText(),t310.getText(),t311.getText(),t312.getText(),date3.getText());
							}
							catch(Exception e)
							{
								System.out.println("somethign happened nursing documentation");
							}
							}
						
					}
				}
				dispose();
			}
		});
		btnNewButton_3.setBounds(346, 390, 89, 23);
		contentPane.add(btnNewButton_3);
		
		btnNewButton_4 = new JButton("Clear");
		btnNewButton_4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				t11.setText("");
				t12.setText("");
				t13.setText("");
				t14.setText("");
				t15.setText("");
				t16.setText("");
				t17.setText("");
				t18.setText("");
				t19.setText("");
				t110.setText("");
				t111.setText("");
				t112.setText("");
				t21.setText("");
				t22.setText("");
				t23.setText("");
				t24.setText("");
				t25.setText("");
				t26.setText("");
				t27.setText("");
				t28.setText("");
				t29.setText("");
				t210.setText("");
				t211.setText("");
				t212.setText("");
				t31.setText("");
				t32.setText("");
				t33.setText("");
				t34.setText("");
				t35.setText("");
				t36.setText("");
				t37.setText("");
				t38.setText("");
				t39.setText("");
				t310.setText("");
				t311.setText("");
				t312.setText("");
			}
		});
		btnNewButton_4.setBounds(549, 390, 89, 23);
		contentPane.add(btnNewButton_4);
	}
	   
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                NursingDocumentation frame= new NursingDocumentation("somebody");
               frame.pack();
            	frame.setVisible(true);
            	
            	
            }
        });
    }


}
